package com.security.frame.core.common;


import lombok.extern.slf4j.Slf4j;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionSignUp;
import org.springframework.stereotype.Component;

/**
 * 自动注册
 *
 * @author wangjie
 * @version V1.0
 * @date 2019/11/12
 */
@Component("myConnectionSignUp")
@Slf4j
public class MyConnectionSignUp implements ConnectionSignUp {


	@Override
	public String execute(Connection<?> connection) {
		//根据社交用户信息默认创建用户并返回用户唯一标识
		log.info("【昵称】：{}",connection.getDisplayName());
		return connection.getDisplayName();
	}

}
